package com.mccken.demo.temp;

import java.util.Stack;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2024-02-18 22:09
 **/
public class Temp1 {

	static Stack<Double> stack = new Stack<>();
	static Double init = 0.9D;

	private static void pushScore(int score1) {
		double score = 0D;
		if (stack.isEmpty()) {
			score = score1 + init;
		} else {
			Double peek = stack.peek();
			double k1 = peek - score1;
			double k2 = 1 / (0.1 + 1 / k1);
			score = score1 + k2;
		}
		stack.push(score);
	}

	public static void main(String[] args) {
		int score_1 = 10;

		// 现在有一批用户已经达到这个分数了
		for (int i = 0; i < 100; i++) {
			pushScore(score_1);
		}

		for (int i = 0; i < 20; i++) {
			System.out.println(stack.pop());
		}
	}
}
